﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers.world {
    import net.wooga.pets.events.*;
    import net.wooga.pets.interfaces.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;
    import net.wooga.pets.models.world.*;

    public class EnforceNextPatientActionCommand extends Command {

        public var event:InfoEvent;
        public var world:WorldModel;

        override public function execute():void{
            var _local1:ITreatable = (this.world.getActor(this.event.id) as ITreatable);
            switch (_local1.state){
                case WorldConstants.ILL:
                    _local1.moveToNextTarget(GameConstants.TYPE_RECEPTION);
                    break;
                case WorldConstants.CURED:
                    _local1.moveToNextTarget(GameConstants.TYPE_ENTRANCE_AREA);
                    break;
                case WorldConstants.BABY:
                    _local1.moveToNextTarget(GameConstants.TYPE_KINDERGARTEN);
                    break;
                default:
                    _local1.moveToNextTreatment();
            };
            dispatch(new InfoEvent(EventConstants.REPORT_PROBLEM, (this.event.info as String), null));
        }

    }
}//package net.wooga.pets.controllers.world 
